package com.yunxin.download.server.infra.repository;

import com.yunxin.download.server.infra.repository.mapper.DownloadDataSourceConfigMapper;
import com.yunxin.download.server.model.query.result.DataSourceInfoResult;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author zero°
 * @since 2023-06-13
 */
@Repository
public interface DownloadDataSourceConfigDao extends DownloadDataSourceConfigMapper {

    /**
     * 根据数据源名称及系统code查询数据源配置
     * @param sourceName sourceName
     * @param systemCode systemCode
     * @return DownloadDataSourceConfigId
     */
    Long selectDataSourceIdBySourceNameAndSystemCode(@Param("sourceName") String sourceName,
                                                     @Param("systemCode") String systemCode);

    /**
     * 获取所有数据源配置
     * @return List<DataSourceInfoResult>
     */
    List<DataSourceInfoResult> listAll();
}
